//
//  BUBaseRequestManager.h
//  BUBU3D
//
//  Created by lichentao on 14-7-22.
//  Copyright (c) 2014年 chentaoApp. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFHTTPRequestOperationManager.h"
#import "MBProgressHUD.h"

// 成功失败 SUCCESS or FAIL
typedef void (^SuccessBlock)(BOOL isSuccess);
// 返回 DATA NSDictionary
typedef void (^SuccessDicBlock)(NSDictionary *dic);
// 返回 ERROR MSG
typedef void (^FailureBlock)(NSString *errorMsg);


@interface BUBaseRequestManager : NSObject{
    SuccessBlock successBlock;
}

//+ (BUBaseRequestManager *)sharedRequest;

// 返回成功或者失败
- (void)requestPostWithParameterForSuccessOrFailBlock:(NSString *)path SetParamer:(NSDictionary *)parameter success:(void (^)(BOOL  isSuccess))success
                                              failure:(void (^)(NSString *errorMsg))failure;

// 公共get
- (void)requestGetWithParameterWithBlockDic:(NSString *)path SetParamer:(NSDictionary *)parameter
                                     success:(void (^)(NSDictionary  *responseDictionary))success
                                     failure:(void (^)(NSString *errorMsg))failure;

// 公共post
- (void)requestPostWithParameterWithBlockDic:(NSString *)path SetParamer:(NSDictionary *)parameter
                                     success:(void (^)(NSDictionary  *responseDictionary))success
                                     failure:(void (^)(NSString *errorMsg))failure;

// 上传图片 post
- (void)requestLoadImgWihtPathAndImgPath:(NSString *)path setParamer:(NSDictionary *)paramer SetImgPath:(NSString *)imgPath
                                 success:(void (^)(NSDictionary  *responseDictionary))success
                                 failure:(void (^)(NSString *errorMsg))failure;

// 失败消息回调
- (void)reCallBackErrorMsgSetResponseDictionary:(NSDictionary *)responseDictionary failure:(void (^)(NSString *errorMsg))failure;

@end
